package com.inoneone.youba.mcht.service;

import com.inoneone.youba.mcht.dao.po.Card;
import com.inoneone.youba.mcht.dto.PageRsp;
import com.inoneone.youba.mcht.dto.req.*;
import com.inoneone.youba.mcht.dto.rsp.CardFlowRsp;
import com.inoneone.youba.mcht.dto.rsp.MyCardsRsp;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;

public interface CardApi {

    /**
     * Description: 校验ic是否存在，查询ic卡</br>
     * Date: 2017-07-04 11:24:02</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    Card queryCard(String cardId, String mchId);

    /**
     * Description: 批量充值ic卡是否存在校验</br>
     * Date: 2017-07-04 12:06:54</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    void checkBatchCards(List<String> cardIds, String mchId);

    /**
     * Description: 查询ic卡列表信息</br>
     * Date: 2017-07-04 11:55:07</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    PageRsp<MyCardsRsp> queryCard(MyCardsReq myCardsReq, String mchId);

    /**
     * Description: 根据关键字查询ic卡信息</br>
     * Date: 2017-07-19 16:47:33</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    PageRsp<MyCardsRsp> queryCardPlus(String keyWords, String mchId, int pageNum, int pageSize);

    /**
     * Description: 查询流水信息</br>
     * Date: 2017-06-26 16:27:13</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    PageRsp<CardFlowRsp> cardFlow(CardFlowReq cardFlowReq, String mchId);

    /**
     * Description: ic卡充值操作</br>
     * Date: 2017-06-27 16:00:47</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    BigDecimal recharge(RechargeReq rechargeReq, String mchId);

    /**
     * Description: 冻结或者解冻</br>
     * Date: 2017-06-27 17:54:02</br>
     *
     * @param cardStatus
     * @see com.inoneone.toolkit.enums.CardStatus
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    void freeze(FreezeReq freezeReq, int cardStatus, String mchId);

    /**
     * Description: 扣款</br>
     * Date: 2017-06-27 17:54:10</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    @Transactional
    BigDecimal reduce(RechargeReq rechargeReq, String mchId, boolean isPay);

    /**
     * Description: 修改信息</br>
     * Date: 2017-06-27 17:54:25</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    void editCard(EditCardReq editCardReq, String mchId);

    /**
     * Description: 批量充值</br>
     * Date: 2017-06-28 11:32:58</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    void batchRecharge(BatchRechargeReq batchRechargeReq, String mchId);

    /**
     * Description: 不同金额批量充值</br>
     * Date: 2017-06-28 11:33:19</br>
     *
     * @param
     * @return
     * @author 姬远玄
     * @since JDK 1.7
    */
    @Transactional
    void batchRecharge2(BatchRecharge2Req batchRecharge2Req, String mchId);
}
